import sqlite3

# 查询数据(多条数据）
con = sqlite3.connect("db1.db")
sql = 'select * from t_person'
cursor = con.cursor()

try:
    cursor.execute(sql)
    person_all = cursor.fetchall()
    # print(person_all)
    for p in person_all:
        print(p)
except Exception as e:
    print(e)
    print("查询数据失败")
finally:
    cursor.close()
    con.close()